import React from 'react'
import { IViewListProp } from '../interfaces'
import TodoView from './TodoView'

const TodoViewList: React.FC<IViewListProp> = ({
  todos,
  selectTodoById,
  removeTodoById
}) => (
  <div>
    {todos.map((item, index) => (
      <TodoView
        key={index}
        todo={item}
        selectTodoById={selectTodoById}
        removeTodoById={removeTodoById}
      />
    ))}
  </div>
)

export default TodoViewList
